#include<iostream>
#include<vector>
#include<set>
#include<string>
#include<map>
using namespace std;

class Solution
{
public:
    vector<string> uncommonFromSentences(string s1, string s2)
    {
        vector<string> res;
        map<string, int> mp;
        string s;
        for (auto ch : s1)
        {

            if (ch == ' ')
            {
                mp[s]++;
                s.clear();
                continue;
            }
            s += ch;
        }
        mp[s]++;
        s.clear();
        for (auto ch : s2)
        {
            if (ch == ' ')
            {
                mp[s]++;
                s.clear();
                continue;
            }
            s += ch;
        }
        mp[s]++;
        s.clear();
        auto it = mp.begin();
        while (it != mp.end())
        {
            if (it->second == 1)
            {
                res.push_back(it->first);
            }
            it++;
        }
        return res;
    }
};